app.controller("goodsController",function($scope,
                                          $controller,goodsService,itemCatService){
    $controller("baseController",{$scope:$scope});
    $scope.searchEntity = {};
    $scope.list = [];
    $scope.state = ["未审核","审核通过","审核未通过","关闭"];
    $scope.itemCatArr = [];

    $scope.search = function(page,rows){
        goodsService.findPage(page,rows,$scope.searchEntity).then(function(result){
            $scope.pageModel.totalItems = result.data.total;
            $scope.list = result.data.rows;
        });
    }
    $scope.findItemCatList = function(){
        //所有分类查询出来
        itemCatService.findAll().then(function(result){
            for(var i=0;i<result.data.length;i++){
                $scope.itemCatArr[result.data[i].id]=result.data[i].name;
            };
        });
    }
});